#!/bin/bash
# scripts/build-all.sh

# 生成设计规范图标
convert src-tauri/icons/deepin_icon.png \
  -resize 128x128! \
  -fill "#1890ff" -opaque black \
  packaging/icons/128x128.png

# 构建DEB包
dpkg-buildpackage -us -uc -B

# 构建玲珑包
ll-builder build packaging/linglong \
  --pkg arch=x86_64 \
  --pkg version=1.0.0

# 构建Flatpak
flatpak-builder build-dir packaging/flatpak/org.deepin.Classifier.yml --force-clean

# 构建Snap
snapcraft --use-lxd --enable-experimental-plugins

# 设计规范验证（严格匹配图像参数）
check_border_color() {
  css_value=$(grep -oP 'border-color:\s*\K[^;]+' src/style.css)
  [ "$css_value" = "#1890ff" ] || exit 1
}
check_font_family() {
  grep -q "Microsoft YaHei" src/style.css || exit 1
}